<template>
  <div class="add-friend-modal">
    <div class="modal-mask"></div>
    <div class="content">
      <div class="title">添加好友</div>
      <div class="search-wrapper">
        <input placeholder="请输入账号进行搜索"/>
        <div class="btn">
          <i class="iconfont chat-search"></i>
        </div>
      </div>
      <div class="list">
<!--        <div class="empty">-->
<!--          <img src="@/assets/images/empty-list-search.png">-->
<!--        </div>-->
        <div class="item">
          <img class="avatar" src="@/assets/images/avatar.jpg" alt="">
          <div class="nickname">ganganlee</div>
          <div class="add">添加</div>
        </div>
      </div>
      <div class="footer">
        <div class="btn" @click="changeFriendStatus(false)">取消</div>
        <div class="btn">添加</div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
let {changeFriendStatus} = defineProps({
  changeFriendStatus: Function,
})
</script>

<style scoped lang="scss">
.add-friend-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  .modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
  }

  .content {
    width: 800px;
    height: 500px;
    background: #fff;
    border-radius: 8px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;

    .title {
      font-size: 20px;
      line-height: 48px;
      height: 48px;
      text-align: center;
    }

    .search-wrapper {
      display: flex;
      border: 1px solid #ccc;
      margin: 0 16px 8px;
      line-height: 40px;
      height: 40px;
      border-radius: 8px;
      overflow: hidden;

      input {
        flex: 1;
        border: none;
        outline: none;
        padding: 0 8px;
      }

      .btn {
        cursor: pointer;
        width: 60px;
        display: flex;
        justify-content: center;
        background: #ccc;
        color: #fff;

        .iconfont {
          font-size: 20px;
        }
      }
    }

    .list {
      flex: 1;
      padding: 16px;
      .empty {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;

        img {
          width: 200px;
        }
      }

      .item{
        display: flex;
        background: #ccc;
        border-radius: 8px;
        flex-direction: column;
        width: 100px;
        overflow: hidden;
        justify-content: center;
        align-items: center;
        padding: 8px;
        .avatar{
          width: 40px;
          border-radius: 4px;
        }
        .nickname{
          font-size: 14px;
          line-height: 20px;
        }
        .add{
          background: #fff;
          width: 100%;
          text-align: center;
          font-size: 14px;
          height: 24px;
          line-height: 24px;
          border-radius: 4px;
          margin-top: 8px;
          cursor: pointer;
        }
      }
    }

    .footer {
      display: flex;
      gap: 16px;
      padding: 8px 16px;
      justify-content: right;

      .btn {
        line-height: 40px;
        height: 40px;
        padding: 0 24px;
        border: 1px solid #ccc;
        border-radius: 8px;
        cursor: pointer;
      }
    }
  }
}
</style>